var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.eMaterialType = undefined;
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var ccp_menu = cc__decorator.menu;
(function (e) {
  e[e.Normal = 0] = "Normal";
  e[e.Gray = 1] = "Gray";
})(exports.eMaterialType || (exports.eMaterialType = {}));
var def_ChangeMaterial = /* */function (_cc$Component3) {
  function _ctor() {
    var _this9;
    babel_classCallCheck(this, _ctor);
    _this9 = _callSuper(this, _ctor, arguments);
    _this9.materials = [];
    _this9.includeChild = false;
    return _this9;
  }
  babel_inherits(_ctor, _cc$Component3);
  return babel_createClass(_ctor, [{
    key: "setItemSprite",
    value: function setItemSprite(e) {
      var _this10 = this;
      var t;
      if (this.includeChild) {
        this.node.walk(function (t) {
          var n;
          null === (n = t.getComponent(cc.Sprite)) || undefined === n || n.setMaterial(0, _this10.materials[e]);
        }, null);
      } else {
        null === (t = this.node.getComponent(cc.Sprite)) || undefined === t || t.setMaterial(0, this.materials[e]);
      }
    }
  }]);
}(cc.Component);
cc__decorate([ccp_property(cc.Material)], def_ChangeMaterial.prototype, "materials", undefined);
cc__decorate([ccp_property(cc.Boolean)], def_ChangeMaterial.prototype, "includeChild", undefined);
def_ChangeMaterial = cc__decorate([ccp_ccclass, ccp_menu("v-lez/ChangeMaterial")], def_ChangeMaterial);
exports.default = def_ChangeMaterial;